<?php

class EmploymentContractService extends BaseService
{

    private $employmentContractDao;

    public function __construct()
    {
        $this->employmentContractDao = new EmploymentContractDao();
    }

    public function getEmploymentContractDao()
    {
        if (!($this->employmentContractDao instanceof EmploymentContractDao)) {
            $this->employmentContractDao = new EmploymentContractDao();
        }
        return $this->employmentContractDao;
    }

    public function setEmploymentContractDao(EmploymentContractDao $employmentContractDao)
    {
        $this->employmentContractDao = $employmentContractDao;
    }

    public function getEmploymentContractListByEmployeeNumber($empNumber, $sortField = 'start_date', $sortOrder = 'ASC', $limit = null, $offset = null)
    {
        return $this->getEmploymentContractDao()->getEmploymentContractListByEmployeeNumber($empNumber, $sortField, $sortOrder, $limit, $offset);
    }

    public function deleteEmploymentContract($toBeDeletedEmploymentContractIds)
    {
        return $this->getEmploymentContractDao()->deleteEmploymentContract($toBeDeletedEmploymentContractIds);
    }

    public function getEmploymentContractById($employmentContractId)
    {
        return $this->getEmploymentContractDao()->getEmploymentContractById($employmentContractId);
    }

}

